<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function f() { console.log('I am outside!'); }

        (function () {
            if (false) {
                // 重复声明一次函数f
                function f() { console.log('I am inside!'); }
            }

            // f();
        }());
        // f()
        if(true) var x = 10; // if判断如果只有一行，可以缩写
        if(true) {
            var x = 10;
            console.log(x+1);
        }
    </script>
</body>

</html>